package com.qzsoft.system.modules.sysloglogin.controller;

import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qzsoft.jeemis.common.utils.Result;
import com.qzsoft.system.modules.sysloglogin.entity.ZhjdSysLogLoginEntity;
import com.qzsoft.system.modules.sysloglogin.service.ZhjdSysLogLoginService;
import com.qzsoft.zhjd.common.utils.ResultUtils;

/**
 * @ClassName ZhjdSysLogLoginController
 * @Description 登录日志控制器
 * @author linhuawei
 * @since 2022-05-16
 */
@RestController
@RequestMapping("/api/sysLogLogin")
public class ZhjdSysLogLoginController {

    @Autowired
    private ZhjdSysLogLoginService zhjdSysLogLoginService;

    /**
     * @Title page
     * @Description 获取登录日志分页数据
     * @param params 查询条件
     * @return 分页数据
     */
    @GetMapping("/page")
    public Result<IPage<ZhjdSysLogLoginEntity>> page(@RequestParam Map<String, Object> params) {
        IPage<ZhjdSysLogLoginEntity> page = zhjdSysLogLoginService.page(params);
        return ResultUtils.ok(page);
    }

    /**
     * @Title export
     * @Description 导出excel文件
     * @param params
     */
    @GetMapping("/export")
    public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) {
        zhjdSysLogLoginService.export(params, response);
    }

}
